package Test;

import MyStack.MinStack;
import MyStack.MyArrayStack;

import java.util.Random;

public class TestStack extends Test {
    public void test() {
        MyArrayStack<Integer> stack1 = new MyArrayStack<>();
        System.out.println(stack1.pop());
        for(int i = 0; i < 5; i++) {
            stack1.push(i);
        }
        for(int i = 0; i < 5; i++) {
            System.out.print(stack1.peek());
            System.out.println(stack1.pop());
        }
    }
    public static void test_MinStack() {
        MinStack<Integer> minStack = new MinStack<Integer>();
        Random random = new Random();
        for(int i = 0; i < 6; i++) {
            minStack.push(random.nextInt()%10);
        }
        System.out.println(minStack);
        for(int i = 0; i <= 6; i++) {
            minStack.pop();
            System.out.println(minStack);
        }
    }

    public TestStack(int num) {
        super(num);
    }

    public TestStack() {
    }

    @Override
    public String toString() {
        return "TestStack: " + num;
    }
}
